home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000067_icon-group-sender _Fri Mar 8 10:23:30 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 8 Mar 1996 09:04:10 MST
  2. Message-Id: <31400AA2.6B5E@tees.ac.uk>
  3. Date: Fri, 08 Mar 1996 10:23:30 +0000
  4. From: Ken Walker <kwalker@premenos.com>
  5. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  6. Mime-Version: 1.0
  7. To: icon-group@cs.arizona.edu
  8. Subject: Re: 'right-handed' operators
  9. References: <313F0690.6BBD@gemini.edu>
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: O
  14.  
  15. Steve Wampler wrote:
  16.  
  17. > Why not just use the following for those (hopefully rare)
  18. > cases where the right-hand side value is needed:
  19. >
  20. >    rhsv("<",e1,e2)
  21. >
  22. > where rhsv is:
  23. >
  24. >    procedure rhsv(op, l, r)
  25. >       return if op(l,r) then r
  26. >    end
  27.  
  28.  
  29. I don't know if Steve actually meant the left-hand-side value, 
  30. because it's the RHS that is normally produced by operators. 
  31. However assuming that we have an equivalent lhsv procedure, then 
  32. I would agree that
  33.  
  34.    write(e1 < lhsv("<",e2,e3))
  35.  
  36. is better than
  37.  
  38.    write(e1 < ((temp := e2) < e3, temp))      # help ma bob!
  39.  
  40. but I still have a partiality for
  41.  
  42.    write(e1 < e2 ^< e3)
  43.  
  44. One observation about the lhsv procedure: Because the second
  45. expression may not be susceptible to repeated evaluation (e.g.
  46. because it might read from a file), the code would have to be
  47.  
  48.    return if op(temp:=l,r) then temp
  49.  
  50. While I wouldn't quite say that the RHS was required only rarely, 
  51. nevertheless I think it's true that we need to have an operator 
  52. produce its LHS just as often as the RHS. I would like the 
  53. language to support that without requiring the rather inelegant 
  54. workarounds currently necessary.
  55.  
  56. | Hamish Lawson, School of Computing and Mathematics, 
  57. | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA 
  58. | Tel: +44 1642 218121 x3611  Fax: +44 1642 342604
  59. | E-mail: H.Lawson@tees.ac.uk
  60.